package cn.iocoder.yudao.module.scrm.enums.refund;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author LiZhiMin
 * @Date 2024/9/24 18:13
 */
@Getter
@AllArgsConstructor
public enum ScrmRefundCommissionStatusEnum {


    HAVE_COMMISSION(1, "已发放"),
    NOT_HAVE_COMMISSION(0, "未发放");

    private final Integer code;
    private final String description;


    // 根据状态码获取对应的枚举
    public static String getDescriptionByCode(Integer code) {
        for (ScrmRefundCommissionStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status.getDescription();
            }
        }
        return "未知状态";
    }

    public static List<String> returnDescription() {
        return Arrays.stream(values())
                .map(ScrmRefundCommissionStatusEnum::getDescription)
                .collect(Collectors.toList());
    }
}
